#include<iostream>
#include<cstring>
using namespace std;
const int maxn = 205;

int u[maxn],n,m,map[maxn][maxn];//未染色-1   黑0  白1
bool re = true;


void dfs(int x){
		for(int i=0;i<n;i++){
			if(map[x][i]== -1)	continue;
			if(u[i] == -1){
				u[i] = (u[x]+1)%2;
				dfs(i);
			}
			if(u[x] != u[i])	continue;
			if(u[x] == u[i]){
					re = false;
					return;
			}
		}		
}

int main(){
	while(cin>>n>>m){
		int a,b;
		memset(map,-1,sizeof map);
		memset(u,-1,sizeof u);
		re = true;
		for(int i=1;i<=m;i++){
			cin>>a>>b;
			map[a][b]=1;
			map[b][a]=1;
		}
		u[0] = 0;

		dfs(0);
		
		if(re == true){
			cout<<"BICOLORABLE."<<endl;
		}else{
			cout<<"NOT BICOLORABLE."<<endl;
		}
	}
	return 0;
}
 
